/*
                  SummaryInfo Class Definition
*/

#ifndef SUMMARYINFO_H
#define SUMMARYINFO_H

#include <string>

#include "Player.h"

using namespace std;

struct PlayerGameInfo
{
    PlayerGameInfo(const string& strNewName, const int& iNewScore, const int& iNewTotal, const int& iNewKills, const int& iNewDeaths)
    {
        iScore = iNewScore;
        iTotalGameScore = iNewTotal;
        iKills = iNewKills;
        iDeaths = iNewDeaths;
        strName = strNewName;

        if (iKills == 0 || iDeaths == 0)
        {
            fKillDeathRatio = iKills;
        }
        else
        {
            fKillDeathRatio = (float)iKills / (float)iDeaths;
        }
    }

    int iScore;
    int iTotalGameScore;
    int iKills;
    int iDeaths;
    string strName;
    float fKillDeathRatio;
};

class SummaryInfo
{
    public:
        ~SummaryInfo() {}

        static void AddPlayerInfo(Player* Player, bool bIsWinner = false);
        static void FreeInfo();

        static vector<PlayerGameInfo*> PlayerInfo;
        static int iWinner;

    private:
        SummaryInfo() {}
};

#endif
